package com.zmxstudy.gzu.domain.es;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

//@Document(indexName = "skuinfo",type = "docs")
@Document(indexName = "skuinfo")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@NoArgsConstructor
public class SkuInfo implements Serializable {
    //商品id，同时也是商品编号
    @Id
    private Long id;

    private String sn;

    //SKU名称
    @Field(type = FieldType.Text)
    private String name;

    //商品价格，单位为：元
    @Field(type = FieldType.Double)
    private int price;

    //库存数量
    private Integer num;

    //商品图片
    private String image;

    private String images;

    private Integer weight;

    //商品状态，1-正常，2-下架，3-删除
    private String status;

    //创建时间
    private Date createTime;

    //更新时间
    private Date updateTime;



    //SPUID
    private Long spuId;

    //类目ID
    private Long categoryId;



    //品牌名称
    @Field(type = FieldType.Keyword)
    private Long brandId;

    //规格
    private String spec;

    private Integer commentNum;

    private Integer saleNum;

    private String All;

//    //规格参数
//    private Map<String, Object> specMap;

    //...略
}